<template>
  <a-card :bordered="false">
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :scroll="{ x: 'auto' }"
        class="j-table-force-nowrap"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" v-has="'commission:edit'">编辑</a>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <!-- 表单区域 -->
    <xhdjUserInfo-modal ref="modalForm" @ok="modalFormOk"></xhdjUserInfo-modal>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import XhdjUserInfoModal from './modules/xhdjUserCommissionConfigServiceModal'

export default {
  name: 'xhdjUserCommissionConfigService',
  mixins: [JeecgListMixin],
  components: {
    XhdjUserInfoModal
  },
  statuses: {
    0: false,
    1: true
  },
  data () {
    return {
      description: '技师表管理页面',
      options: [
        {
          value: '1',
          label: '上线'
        },
        {
          value: '0',
          label: '下线'
        }
      ],
      optionses: [
        {
          value: '2',
          label: '审核不通过'
        },
        {
          value: '1',
          label: '已审核'
        },
        {
          value: '0',
          label: '未审核'
        }
      ],
      // checkStatuses: {
      //   0: '审核中',
      //   1: '审核通过',
      //   2: '审核未通过',
      // },
      checkStatuses: [
        { title: '审核中', color: 'orange' },
        { title: '审核通过', color: 'green' },
        { title: '审核未通过', color: 'red' }
      ],
      // 表头
      columns: [
        {
          title: '推广用户抽成比例',
          align: 'center',
          dataIndex: 'rate',
          customRender: (text, record) => {
            return record.rate + ' %'
          }
        },
        {
          title: '推广技师抽成比例',
          align: 'center',
          dataIndex: 'coachRate',
          customRender: (text, record) => {
            return record.coachRate + ' %'
          }
        },
        {
          title: '等级',
          align: 'center',
          dataIndex: 'top'
        },
        {
          title: '更新时间',
          align: 'center',
          dataIndex: 'updateTime'
        },
        {
          title: '创建时间',
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      userAuthList: [],
      ids: [],
      url: {
        list: '/user/xhdjUserSalesman/getRule'
      }
    }
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  created () {},
  methods: {}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.ant-form {
  display: flex;
  justify-content: flex-end;
}
.ant-row {
  display: flex;
  justify-content: flex-end;
}
</style>
